package com.haiyou.dc.aggregate.set;

import java.util.HashSet;
import java.util.Set;

public class TestDog {

    public static void main(String[] args) {
        Dog dog1 = new Dog("旺财", 2, "公");
        Dog dog2 = new Dog("旺财", 2, "公");
        System.out.println(dog1 == dog2);

        Set<Dog> dogs = new HashSet<>();
        dogs.add(dog1);
        dogs.add(dog2);
        dogs.add(null);
        dogs.forEach(x -> {
            System.out.println(x);
        });
    }
}
